package com.irssproject.app.dao.lectorRSS.iface;

import com.irssproject.app.entitats.Topic;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;

import com.irssproject.app.entitats.Label;
import com.irssproject.app.entitats.Feed;
import com.irssproject.app.entitats.Item;
import com.irssproject.app.entitats.Reading;
import com.irssproject.app.entitats.Subscription;
import com.irssproject.app.entitats.User;
import java.util.Collection;

public interface SubscriptionsDAO {

    public List<Subscription> getListSubscripcions(User usuari, Boolean fromRecommendation);

    public void updateSubscripcio(Subscription subscripcio);

    public void insertSubscription(Subscription subscripcio);

    public void deleteSubscripcio(Long idSubscripcio);

    public List<Reading> getAllReadingsOnInterval(Subscription subs, Integer toElement) throws Exception;

    public Timestamp getDarreraDataPublicacio(Subscription subscripcio);

    public Item getItemByLink(String link);

    public Reading getLecturaById(Long idLectura);
    /*
     * operacions segures fins aqui
     */

    public List<Reading> getStarredReadingsOnInterval(User usuari, Integer toElement) throws Exception;

    public Date getDataDarrerItem(Subscription subscripcio);

    public Subscription getSubscripcioByFeedLink(User usuari, String feedLink);

    public Item getItem(Item item);

    public void definirRellevanciaDeLectura(Reading lectura);

    public Integer getNumItemsSubscripcio(Subscription subscripcio);

    public Feed getUserFeed(User usuari, String feedLink);

    public Subscription getSubscripcioById(Long idSubscripcio);

    public void refreshSubscripcio(Subscription subscripcio);

    public void insertItems(List<Item> items);

    public Long insertItem(Item item);

    public List<Label> getListEtiquetes(User usuari);

    public boolean marcarLlegidaONoLlegida(Long idLectura);

    public boolean valorarLectura(Long idLectura);

    public List<Reading> getReadingsOnInterval(Subscription subscripcio, Integer toElement) throws Exception;

    public void marcarTotesLecturesLlegides(Long idSubscripcio);

    public List<Reading> getLecturesBySubscripcioId(Long idSubscripcio);

    public Item getItemById(Long id);

    public List<Reading> getReadingsOnPeriod(Date from, Date since, Long id);

    public List<Reading> getTopLecturesBySubscripcioId(Long id, int clusteringReadingsSize);

    public List<User> getUsersSubscribed(User connectedUser);

    public List<Topic> getTopicsSubscribed(User connectedUser);

    public void insertReading(Reading reading);

    public boolean existsReading(Subscription subs, Item item);

    public void markItemAsReaded(Reading reading, int numItems);

    public List<Feed> getFeedsLstByTopic(User user, Topic topic);

    public List<Topic> getTopicLstLikeName(String topic);

    public Collection<? extends Item> getItemsLstByTopic(User connectedUser, Topic t);
}
